package com.sinvo.oa.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sinvo.oa.entity.model.system.SysOperLog;
import com.sinvo.oa.entity.vo.system.SysOperLogQueryVo;
import com.sinvo.oa.result.R;
import com.sinvo.oa.service.SysOperLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 操作日志控制器
 */
@Api(tags = "操作日志管理接口")
@RestController
@RequestMapping("admin/system/sysOperLog")
public class SysOperLogController {

    @Autowired
    private SysOperLogService sysOperLogService;

    @PreAuthorize("hasAuthority('btn.sysOperLog.list')")
    @ApiOperation(value = "条件分页查询")
    @GetMapping("{pageNum}/{pageSize}")
    public R pageQueryOperLog(@PathVariable Long pageNum,
                              @PathVariable Long pageSize,
                              SysOperLogQueryVo sysOperLogQueryVo){
        Page<SysOperLog> page = new Page<>(pageNum, pageSize);
        page = sysOperLogService.findOperLogByPage(page,sysOperLogQueryVo);
        return R.success(page);
    }

}
